home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gwuada_5.zip / adaed / spider / spider.ads < prev    next >
Text File  |  1993-02-04  |  2KB  |  55 lines

  1.  
  2.    --------------------------------------------------------------------
  3. --|  Package  : Spider                                                 |
  4.    --------------------------------------------------------------------
  5. --|  Abstract :                                                        |
  6. --|     This package provides procedures to emulate "Spider"           |
  7. --|     primitives.  The spider is a robot who can move around         |
  8. --|     the screen drawing simple patterns.                            |
  9. --|                                                                    |
  10.    --------------------------------------------------------------------
  11. --|  File            : spider.ads              Version : 1.0           |
  12. --|  Compiler/System : Alsys ADa                                       |
  13. --|  Author          : John Dalbey             Date :  9/18/92         |
  14.    --------------------------------------------------------------------
  15.  
  16. PACKAGE Spider IS
  17.  
  18. TYPE Switch       IS (on,off);                   -- boolean type
  19. TYPE ScreenColors IS (red, blue, green, black);  -- available colors
  20.  
  21.   PROCEDURE Reset;
  22.   -- Draw the Spider's room on the screen and put the spider in the center.
  23.  
  24.   PROCEDURE Start;
  25.   -- Draw a random size room on the screen and put the spider in the
  26.   -- upper left corner.
  27.  
  28.   -- Change the color of ink with which the spider draws
  29.   PROCEDURE Blue;
  30.   PROCEDURE Green;
  31.   PROCEDURE Red;
  32.   PROCEDURE Black;
  33.  
  34.   PROCEDURE Step;
  35.   -- Take one step forward in the direction the spider is facing.
  36.   -- EXCEPTIONS: Hit_the_Wall is raised if you try to step into a wall.
  37.  
  38.   PROCEDURE Turn;
  39.   -- Turn 90 degrees to the right.
  40.  
  41.   FUNCTION  AtWall return boolean;
  42.   -- Return TRUE if the spider is standing next to a wall (edge of the room)
  43.   -- and facing it.
  44.  
  45.   PROCEDURE Quit;
  46.   -- End the drawing
  47.  
  48.   PROCEDURE Debug (Setting: Switch);
  49.   -- Turn on or off single stepping through the program.
  50.  
  51.   FUNCTION  Debug RETURN Boolean;
  52.   -- Return current debug setting.
  53.  
  54. END Spider;
  55.